#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail
set -o noclobber
set -o noglob

STARTUP_DIR="$( cd "$( dirname "$0" )" && pwd )"

source ${STARTUP_DIR}/../settings.sh

CRUMB=$(curl -s -u ${JENKINS_USER_NAME}:${JENKINS_USER_PASSWORD} 'http://localhost:9090/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)') && \
    curl -X POST -H $CRUMB "http://${JENKINS_USER_NAME}:${JENKINS_USER_PASSWORD}@localhost:9090/job/build-model-images-job/build?TOKEN=RANDTOKEN"

